<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="GENERATOR" content="Mozilla/4.76 [en] (Windows NT 5.0; U) [Netscape]">
   <title>Draw Polytriangle</title>
</head>
<body ONLOAD="if(parent.frames[&quot;&quot;])location=&quot;#nowhere&quot;; if(parent.frames[&quot;frm5&quot;])parent.frames[&quot;frm5&quot;].location=&quot;OpcodesHd.html&quot;">
<b><i><font face="Arial">Draw Polytriangle</font></i></b>
<hr>
<p><font face="Arial Black"><font size=-1>Purpose</font></font>
<ul>The <b>Draw Polytriangle</b> function draws a connected chain of triangles.</ul>
<font face="Arial Black"><font size=-1>Syntax</font></font>
<br>&nbsp;
<center><table BORDER CELLPADDING=9 WIDTH="50%" BORDERCOLOR="#000000" >
<tr>
<td VALIGN=TOP WIDTH="17%" BGCOLOR="#0000A0"><font face="Arial"><font color="#FFFFFF"><font size=-2>Opcode
format</font></font></font></td>

<td VALIGN=TOP WIDTH="14%" BGCOLOR="#0000A0"><font face="Arial"><font color="#FFFFFF"><font size=-2>Opcode</font></font></font>
<p><font face="Arial"><font color="#FFFFFF"><font size=-2>[ASCII] (Hex)</font></font></font></td>

<td VALIGN=TOP WIDTH="30%" BGCOLOR="#0000A0"><font face="Arial"><font color="#FFFFFF"><font size=-2>Operand
Format</font></font></font></td>

<td VALIGN=TOP WIDTH="40%" BGCOLOR="#0000A0"><font face="Arial"><font color="#FFFFFF"><font size=-2>Comments</font></font></font></td>
</tr>

<tr>
<td VALIGN=TOP WIDTH="17%"><font face="Arial"><font size=-2>Single-byte,
ASCII operand&nbsp;</font></font></td>

<td VALIGN=TOP WIDTH="14%"><font face="Courier New"><font size=-2>(T) (54)</font></font></td>

<td VALIGN=TOP WIDTH="30%"><b><font face="Courier New"><font size=-2>[&lt;ws>]&lt;I<sub>Count</sub>>[&lt;ws>&lt;I<sub>Xi</sub>>,&lt;I<sub>Yi</sub>>]<sup>+</sup></font></font></b></td>

<td VALIGN=TOP WIDTH="40%"><font face="Arial"><font size=-2>Absolute coordinates.</font></font></td>
</tr>

<tr>
<td VALIGN=TOP WIDTH="17%"><font face="Arial"><font size=-2>Single-byte,
binary operand</font></font></td>

<td VALIGN=TOP WIDTH="14%"><font face="Courier New"><font size=-2>[t] (74)</font></font></td>

<td VALIGN=TOP WIDTH="30%"><b><font face="Courier New"><font size=-2>&lt;B<sub>Count</sub>>[&lt;US<sub>Ecount</sub>>][&lt;L<sub>Xi</sub>>&lt;L<sub>Yi</sub>>]<sup>+</sup></font></font></b></td>

<td VALIGN=TOP WIDTH="40%"><font face="Arial"><font size=-2>Relative coordinates.</font></font></td>
</tr>

<tr>
<td>-</td>

<td><font face="Courier New"><font size=-2>[Ctrl-T] (14)</font></font></td>

<td><b><font face="Courier New"><font size=-2>&lt;B<sub>Count</sub>>[&lt;US<sub>Ecount</sub>>][&lt;S<sub>Xi</sub>>&lt;S<sub>Yi</sub>>]<sup>+</sup></font></font></b></td>

<td><font face="Arial"><font size=-2>Relative coordinates.</font></font></td>
</tr>

<tr>
<td><font face="Arial"><font size=-2>Extended binrary</font></font></td>

<td><font face="Courier New"><font size=-2>TBD</font></font></td>

<td><b><font face="Courier New"><font size=-2>&lt;B<sub>Count</sub>>[&lt;US<sub>Ecount</sub>>]\</font></font></b>
<br><b><font face="Courier New"><font size=-2>[&lt;L<sub>Xi</sub>>&lt;L<sub>Yi</sub>>&lt;B<sub>Ri</sub>>&lt;B<sub>Gi</sub>>&lt;B<sub>Bi</sub>>&lt;B<sub>Ai</sub>>]]<sup>+</sup></font></font></b></td>

<td><font size=-2>Gouraud, relative coordinates.</font></td>
</tr>

<tr>
<td>-</td>

<td><font face="Courier New"><font size=-2>TBD</font></font></td>

<td><b><font face="Courier New"><font size=-2>&lt;B<sub>Count</sub>>[&lt;US<sub>Ecount</sub>>]&lt;L<sub>Iid</sub>>\</font></font></b>
<br><b><font face="Courier New"><font size=-2>[&lt;L<sub>Xi</sub>>&lt;L<sub>Yi</sub>>&lt;L<sub>Ui</sub>>&lt;L<sub>Vi</sub>>&lt;UL<sub>Wi</sub>>]<sup>+</sup></font></font></b></td>

<td><font size=-2>Texture mapped, relative coordinates.</font></td>
</tr>

<tr>
<td>-</td>

<td><font face="Courier New"><font size=-2>TBD</font></font></td>

<td><b><font face="Courier New"><font size=-2>&lt;B<sub>Count</sub>>[&lt;US<sub>Ecount</sub>>]&lt;L<sub>Iid</sub>>\</font></font></b>
<br><b><font face="Courier New"><font size=-2>[&lt;L<sub>Xi</sub>>&lt;L<sub>Yi</sub>>&lt;B<sub>Ri</sub>>&lt;B<sub>Gi</sub>>&lt;B<sub>Bi</sub>>&lt;B<sub>Ai</sub>>&lt;L<sub>Ui</sub>>&lt;L<sub>Vi</sub>>&lt;UL<sub>Wi</sub>>]<sup>+</sup></font></font></b></td>

<td><font size=-2>Gouraud and texture mapped, relative coordinates.</font></td>
</tr>
</table></center>

<ul><i>Count</i>&nbsp;&nbsp; The number of points in the polytriangle.
When using the binary operand form, a value of zero for <i>count</i> indicates
that an extended count will follow. In the ASCII operand case, <i>count</i>
may be any value larger than zero.
<p><i>Ecount&nbsp;&nbsp; </i>When <i>count</i> is zero, a 2-byte extended
count follows, allowing for polytriangles with vertices from 256 through
65,791 which are encoded as an integer (0 to 65,535).
<p><i>Xi,Yi</i>&nbsp;&nbsp; The <i>i</i><sup>th</sup> point (in logical
coordinates) of the polytriangle.
<p><i>Iid</i>&nbsp;&nbsp; Selects an image previously defined with <a href="DrwImg.html">Draw
Image</a> for use with texture mapping.
<p><i>Ri, Gi, Bi, Ai</i>&nbsp;&nbsp; The color definition at the <i>i</i>th
vertex in the polytriangle.
<p><i>Ui, Vi, Wi</i>&nbsp;&nbsp; The texture coordinate at the <i>i</i>th
vertex in the polytriangle. The coordinate selects colors from the image
selected by the <i>Iid</i> parameter.</ul>
<font face="Arial Black"><font size=-1>Details</font></font>
<ul>Topologically, a polytriangle is a strip of connected triangles, where
each successive triangle in the chain is defined by a single vertex and
two vertices from the previous triangle in the strip, as shown in figure
1.<a NAME="Fig16"></a></ul>

<center><img SRC="Image63.gif" height=204 width=564>
<p><i><font face="Arial,Helvetica">Figure 1. Example polytriangle with
six points</font></i></center>

<ul>A polytriangle is similar to a polygon, but the vertices are specified
in a special order.
<p>When texture mapping, the <i>Ui</i> and <i>Vi</i> parameters correspond
to the horizontal and vertical directions of texture space, and <i>Wi</i>
corresponds to the perspective homogeneous coordinate (used when a 2D projection
is made from a 3D object). The 32-bit value for <i>Ui</i> and <i>Vi</i>
are interpreted as a signed fixed-point texture parameter: the low 16-bits
correspond to the normalized fractional portion of the texture image, and
the high 16-bits correspond to the integer portion.</ul>
<font face="Arial Black"><font size=-1>Notes</font></font>
<ul>If a polytriangle with more than 65,791 triangles is desired, it must
be drawn by multiple <b>Draw Polytriangle</b> opcodes.</ul>
<hr>
<hr WIDTH="100%">
</body>
</html>
